<!DOCTYPE html>
<html lang="en" >
<head>
    <title>Atomsk - Option rotate - Pierre Hirel</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" media="screen" type="text/css" title="Default" href="./default.css" />
    <link rel="icon" href="../img/atomsk_logo.png" type="image/png" />
</head>
   
<body>

<p><a href="./index.html">Back to main menu</a></p>

<h2>Option: rotate</h2>

<h4>Syntax</h4>

<p><code>-rotate [com] &#60;x|y|z&#62; &#60;&theta;&#62;</code></p>

<p><code>-rotate [com] [<em>hkl</em>] &#60;&theta;&#62;</code></p>

<p><code>-rotate [com] &#60;v<sub>x</sub>&#62; &#60;v<sub>y</sub>&#62; &#60;v<sub>z</sub>&#62; &#60;&theta;&#62;</code></p>


<h4>Description</h4>

<p>This option allows to rotate the system (i.e. both the box and atoms) around a given axis.</p>

<p>The axis of rotation can be one of 'x', 'y', 'z' (referring to cartesian axes), or a crystallographic direction defined by its Miller indices  (see <a href="./options.html">how to specify Miller indices</a>). If the crystallographic orientation of the system is defined (e.g. through the <a href="./option_properties.html">option <code>-properties</code></a>) then the Miller indices are considered with respect to that orientation. Otherwise the orientation assumed is X=[100], Y=[010], Z=[001]. It is also possible to give any other direction by entering the Cartesian coordinates of a vector (v<sub>x</sub> v<sub>y</sub> v<sub>z</sub>) in angströms. The angle of rotation &theta; must be provided in degrees.</p>

<p>If the keyword "com" is used, then the center of rotation is the center of mass of the system. Otherwise (i.e. if the keyword is omitted), the center of rotation is the Cartesian origin (0,0,0).</p>

<p>If forces (fx,fy,fz) or velocities (vx,vy,vz) exist as auxiliary properties, then they are rotated accordingly.</p>

<p>This option affects some properties of the system (e.g. the elastic tensor) if they were read with the <a href="./option_properties.html">option <code>-properties</code></a> before the present option.</p>

<p>If a selection was defined (with the <a href="./option_select.html">option <code>-select</code></a>) then the rotation is applied only to selected atoms, and the box is <em>not</em> rotated. If the keyword "com" is used, then the selected atoms are rotated around their center of mass.</p>

<p>After the application of this option, some atoms may end up out of the box, which can be fixed thanks to the <a href="./option_wrap.html">option <code>-wrap</code></a>.</p>




<h4>Default</h4>

<p>By default the system is not rotated.</p>



<h4>Examples</h4>

<ul>
<li><code class="command">atomsk initial.cfg -rotate x 45 final.xyz</code>
<p>This will rotate the whole system (atoms and cell) by 45 degrees around X.</p></li>

<li><code class="command">atomsk initial.cfg -select in cylinder Z 0.5*box 0.5*box 25 -rotate com Z 24° final.xyz</code>
<p>This command will <a href="./option_select.html">select a cylinder</a> of radius 25 &Aring; along Z, then will rotate this cylinder around its center of mass by an angle of 24 degrees around Z. The box will not be rotated.</p></li>

<li><code class="command">atomsk initial.cfg -rotate [111] 45 final.xyz</code>
<p>This will rotate the whole system (atoms and cell) by 45 degrees around the [111] crystal direction.</p></li>

<li><code class="command">atomsk initial.cfg -rotate 1.2 0.0 3.9 21.7 final.xyz</code>
<p>This will rotate the whole system (atoms and cell) by 21.7 degrees around the Cartesian vector of components (1.2 0.0 3.9).</p></li>

</ul>


<p><a href="./index.html">Back to main menu</a></p>

</body>

</html>
